/*
 * main.cpp
 *
 *  Created on: Apr 2, 2010
 *      Author: Sequoyha
 */
#include "OpLab.h"

int main()
{
	Fraction frac1(3,4);
	Fraction frac2(5,6);
	Fraction result;

	result = frac1 + frac2;
	cout << "\n\n( " << frac1.GetNumer() << " / " << frac1.GetDenom()
		<< " ) + ( " << frac2.GetNumer() << " / " << frac2.GetDenom()
		<< " ) = ( " << result.GetNumer() << " / " << result.GetDenom()
		<< " ) ";

	result = frac1 - frac2;
	cout << "\n\n( " << frac1.GetNumer() << " / " << frac1.GetDenom()
		<< " ) - ( " << frac2.GetNumer() << " / " << frac2.GetDenom()
		<< " ) = ( " << result.GetNumer()<< " / " << result.GetDenom()
		<< " ) ";

	result = frac1 * frac2;
	cout << "\n\n( " << frac1.GetNumer() << " / " << frac1.GetDenom()
		<< " ) * ( " << frac2.GetNumer() << " / " << frac2.GetDenom()
		<< " ) = ( " << result.GetNumer()<< " / " << result.GetDenom()
		<< " ) ";

	result = frac1 / frac2;
	cout << "\n\n( " << frac1.GetNumer() << " / " << frac1.GetDenom()
		<< " ) / ( "<< frac2.GetNumer() << " / " << frac2.GetDenom()
		<< " ) = ( " << result.GetNumer()<< " / " << result.GetDenom()
		<< " ) ";

	cout << "\n\nThe two fractions are " << (frac1 == frac2 ? "equal. " : "not equal.");

	//KEYBOARD INPUT OF FRACTIONS TO COMPARE
	Fraction firstFrac;
	Fraction secondFrac;
	cout << "\n\nEnter first fraction as x/x: ";
	cin >> firstFrac;
	cout << "Enter second fraction as x/x: ";
	cin >> secondFrac;

	//COMPARISONS
	cout << "\n" << firstFrac << " is "
		<< (firstFrac < secondFrac ? "less than " : "not less than ") << secondFrac;
	cout << "\n" << firstFrac << " is "
		<< (firstFrac <= secondFrac ? "less than or equal to " : "not less than or equal to ")
		<< secondFrac;
	cout << "\n" << firstFrac << " is "
		<< (firstFrac > secondFrac ? "greater than " : "not greater than ") << secondFrac;
	cout << "\n" << firstFrac << " is "
		<< (firstFrac >= secondFrac ? "greater than or equal to " : "not greater than or equal to ")
		<< secondFrac;
	cout << "\nThe two fractions are " << (firstFrac == secondFrac ? "equal. " : "not equal.");
	cout << "\nI SAID! ";
	cout << "\nThe two fractions are " << (firstFrac != secondFrac ? "not equal." : "equal. ");

	return 0;
}
